<!DOCTYPE html>
<html>
<head>
  <title>Test - Strings</title>
  <link rel="stylesheet" href="../QUnit.css" type="text/css" />
  <script type="text/javascript" src="../QUnit.js"></script>
  <script type="text/javascript" src="../QUnitExt.js"></script>
</head>
<body>
  <h1 id="qunit-header">Test Results</h1>
  <h2 id="qunit-banner"></h2>
  <h2 id="qunit-userAgent"></h2>
  <ol id="qunit-tests"></ol>
  <br />
  <textarea id="qunit-log" rows="10" cols="100"></textarea>
  <script type="text/javascript" src="../Scripts/Sharpen.debug.js"></script>
  <script type="text/javascript" src="../Scripts/Sharpen.dom.debug.js"></script>
  <script type="text/javascript">
  module('DOM.Strings');

  test('htmlEncode', function() {
    var s1 = 'xyz';
    var s2 = '<h1>a "aaa" & a "bbb"</h1>';

    QUnit.equal(ss.htmlEncode(s1), 'xyz');
    QUnit.equal(ss.htmlEncode(s2), '&lt;h1&gt;a &quot;aaa&quot; &amp; a &quot;bbb&quot;&lt;/h1&gt;');
  });

  test('htmlDecode', function() {
    var s1 = 'xyz';
    var s2 = '&lt;h1&gt;a &quot;aaa&quot; &amp; a &quot;bbb&quot;&lt;/h1&gt;';

    QUnit.equal(ss.htmlDecode(s1), 'xyz');
    QUnit.equal(ss.htmlDecode(s2), '<h1>a "aaa" & a "bbb"</h1>');
  });
  </script>
</body>

</html>
